from typing import Optional
from core.context.ctxmgr import context_manager


class ChatService:
    name: Optional[str] = None

    def __init__(self, name: str = ""):
        self.name = name or "default_chat_name"

    def get_username(self) -> str:
        ctx = context_manager.get_context()
        id = ctx.get("request_id")
        return f"{self.name}-{id}"
